{extend name='main'}

{block name="button"}
<!--{if auth("add")}-->
<!--<button data-modal='{:url("add")}' data-title="添加订单" class='layui-btn layui-btn-sm layui-btn-primary'>添加订单</button>-->
<!--{/if}-->
<!--{if auth("remove")}-->
<!--<a data-confirm="确定要删除这些订单吗？" data-action='{:url("remove")}' data-rule="id#{key}" data-csrf="{:systoken('remove')}" class='layui-btn layui-btn-sm layui-btn-primary'>删除订单</a>-->
<!--{/if}-->
{/block}

{block name="content"}
<div class="layui-tab layui-tab-card think-bg-white table-block">
    <div class="layui-tab-content think-box-shadow table-block table-block">
        {include file='order/index_search'}
        <table class="layui-table margin-top-10" lay-skin="line">
            {notempty name='list'}
            <thead>
            <tr>
                <th class='list-table-check-td think-checkbox'>
                    <label><input data-auto-none data-check-target='.list-check-box' type='checkbox'></label>
                </th>
                <th>#</th>
                <th class='text-left nowrap'>订单号</th>
                <th class='text-left nowrap'>用户昵称</th>
                <th class='text-left nowrap'>手机号</th>
                <th class='text-left nowrap'>柜子名称</th>
                <th class='text-left nowrap'>箱门号</th>
                <th class='text-left nowrap'>版号通道</th>
                <th class='text-left nowrap'>收费方式</th>
                <th class='text-left nowrap'>单价</th>
                <th class='text-left nowrap'>已付款</th>
                <th class='text-left nowrap'>订单总额</th>
                <th class='text-left nowrap'>开始时间</th>
                <th class='text-left nowrap'>结束时间</th>
                <th class='text-left nowrap'>订单状态</th>
                <th>操作</th>
            </tr>
            </thead>
            {/notempty}
            <tbody>
            {foreach $list as $key=>$vo}
            <tr data-dbclick>
                <td class='list-table-check-td think-checkbox'>
                    <label><input class="list-check-box" value='{$vo.id}' type='checkbox'></label>
                </td>
                <td class="nowrap">{$vo.id|default=''}</td>
                <td class="nowrap">{$vo.order_no|default=''}</td>
                <td class="nowrap">{$vo.nickname|default=''}</td>
                <td class="nowrap">{$vo.mobile|default=''}{$vo.code|default=''}</td>
                <td class="nowrap">{$vo.device_name|default=''}</td>
                <td class="nowrap">{$vo.box_num|default=''}</td>
                <td class="nowrap">{$vo.device_board|default=''} - {$vo.board_channel|default=''}</td>
                <td class="nowrap">{$fee_types[$vo.fee_type]|default=''}</td>
                <td class="nowrap">{$vo.amount|default=''}</td>
                <td class="nowrap">{$vo.money|default=''}</td>
                <td class="nowrap">{$vo.amount_total|default=''}</td>
                <td class="nowrap">{$vo.create_time|default=''}</td>
                <td class="nowrap">{$vo.reality_end_time|default=''}</td>
                <td class="nowrap">{$arr_status[$vo.status]|default=''}</td>
                <td class='text-left nowrap'>
                    {if auth("logs") && $vo.show_logs}
                    <a class="layui-btn layui-btn-sm layui-btn-normal" data-csrf="{:systoken('logs')}" data-modal='{:url("logs")}?id={$vo.id}'>开关门记录</a>
                    {/if}
                    {if auth("addSale")}
                    <a class="layui-btn layui-btn-sm layui-btn-normal" data-csrf="{:systoken('addSale')}" data-modal='{:url("devices/sales/add")}?order_id={$vo.id}'>添加售后</a>
                    {/if}
                    {if auth("end_order") and ($vo.status eq 1 or $vo.status eq 4)}
                    <a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要结束此订单吗？"  data-value="id#{$vo.id}" data-csrf="{:systoken('end_order')}" data-action='{:url("end_order")}'>结束订单</a>
                    {/if}
                    <!--{if auth("remove")}-->
                    <a class="layui-btn layui-btn-sm layui-btn-danger" data-title="临时开门" data-value="id#{$vo.d_id};order_id#{$vo.id};box_id#{$vo.box_id};ch#{$vo.board_channel};device_board#{$vo.device_board}"  data-action='{:url("boxs/unlock")}'>临时开门</a>
<!--                    <a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除此订单吗？" data-action="{:url('remove')}" data-value="id#{$vo.id}" data-csrf="{:systoken('remove')}">删 除</a>-->
                    <!--{/if}-->
                </td>
            </tr>
            {/foreach}
            </tbody>
        </table>
        {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}
    </div>
</div>
{/block}
